package com.mz.ozy.adapter;

import android.text.TextUtils;
import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mz.ozy.R;
import com.mz.ozy.bean.GoodsListBean;
import com.mz.ozy.bean.VipUpBean;
import com.mz.ozy.utils.glideUtils.GlideUtils;
import com.mz.ozy.widget.CustomRoundAngleImageView;

import java.util.List;

/**
 * @author lifeStyle on 2020/4/3 0003.
 */
public class VipUpListAdapter extends BaseQuickAdapter<VipUpBean.VipListBean, BaseViewHolder> {

    public VipUpListAdapter(@Nullable List<VipUpBean.VipListBean> data) {
        super(R.layout.item_my_vip_list, data);
//        addData(new MallGoodsBean("凯通智造智能随行杯"));
//        addData(new MallGoodsBean("1分钟快速抚平衣服"));
//        addData(new MallGoodsBean("东北香大米2019新米"));
//        addData(new MallGoodsBean("东北香大米2019新米"));
//        addData(new MallGoodsBean("东北香大米2019新米"));
    }

    @Override
    protected void convert(BaseViewHolder helper, VipUpBean.VipListBean item) {

        if (item.getGrade() == 4) {
            helper.setImageResource(R.id.vipImg, R.mipmap.vip1);
            helper.setTextColor(R.id.tv_title,mContext.getResources().getColor(R.color.c_204c25));
            helper.setTextColor(R.id.tv_money,mContext.getResources().getColor(R.color.c_204c25));
            helper.setBackgroundRes(R.id.tv_buy,R.drawable.vip1_bnt);
            helper.setText(R.id.tv_title,"健康顾问");
            helper.setText(R.id.tv_buy,"升级健康顾问");



        } else if (item.getGrade() == 2) {
            helper.setImageResource(R.id.vipImg, R.mipmap.vip2);

            helper.setTextColor(R.id.tv_title,mContext.getResources().getColor(R.color.c_4c3e20));
            helper.setTextColor(R.id.tv_money,mContext.getResources().getColor(R.color.c_4c3e20));
            helper.setBackgroundRes(R.id.tv_buy,R.drawable.vip2_bnt);
            helper.setText(R.id.tv_title,"金卡VIP");
            helper.setText(R.id.tv_buy,"升级金卡会员");

        } else if (item.getGrade() == 1) {
            helper.setImageResource(R.id.vipImg, R.mipmap.vip3);

            helper.setTextColor(R.id.tv_title,mContext.getResources().getColor(R.color.c_32333c));
            helper.setTextColor(R.id.tv_money,mContext.getResources().getColor(R.color.c_32333c));
            helper.setBackgroundRes(R.id.tv_buy,R.drawable.vip2_bnt);

            helper.setText(R.id.tv_title,"VIP");
            helper.setText(R.id.tv_buy,"升级VIP会员");

        }
        helper.setText(R.id.tv_money, "¥"+item.getPrice());
        helper.addOnClickListener(R.id.tv_buy);

    }

}
